Imports System
Imports System.Data
Imports System.Configuration
Imports System.Collections
Imports System.Web
Imports System.Web.Security
Imports System.Web.UI
Imports System.Web.UI.WebControls
Imports System.Web.UI.WebControls.WebParts
Imports System.Web.UI.HtmlControls
Imports System.Xml
Imports System.Xml.Xsl

Partial Public Class UserCuntrols_CustomDropDownJSON
    Inherits System.Web.UI.UserControl

    Private _ItemStack As New Stack
    Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
        If Not Page.IsPostBack Then
            BindData()
        End If
        If Request.Browser.Browser = "IE" Then
            imgDropdown.Style.Add("margin-top", "-5px")
        End If
    End Sub

    Private Sub BindData()
        Dim oXmlDocument As New XmlDocument()
        oXmlDocument.Load(Server.MapPath("~/XML/WebCategory.xml"))
        Dim oXslDocument As New XslCompiledTransform()
        oXslDocument.Load(Server.MapPath("~/XSL/DropDownMenuJSON.xsl"))
        Dim _Stream As New System.IO.MemoryStream()
        Dim _stringBuilder As New System.Text.StringBuilder()
        Dim _stringWriter As New System.IO.StringWriter(_stringBuilder)

        Dim oXsltArgumentList As New XsltArgumentList()

        oXslDocument.Transform(oXmlDocument, oXsltArgumentList, _stringWriter)
        litDropDownContent.Text = _stringBuilder.ToString().Replace("~/", ResolveUrl("~/"))

    End Sub
End Class
